<!DOCTYPE html>

<html lang="en">
<head>
	<meta charset="utf-8">
	<title>najaxjs Source: default/najax-class.static.js</title>

	<!--[if lt IE 9]>
	<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
	<link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">

	<link type="text/css" rel="stylesheet" href="styles/site.yeti.css">

</head>

<body>

<div class="navbar navbar-default navbar-fixed-top navbar-inverse">
<div class="container">
	<div class="navbar-header">
		<a class="navbar-brand" href="index.html">najaxjs</a>
		<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
			<span class="icon-bar"></span>
        </button>
	</div>
	<div class="navbar-collapse collapse" id="topNavigation">
		<ul class="nav navbar-nav">
			
			<li class="dropdown">
				<a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="$najax.html">$najax</a></li><li><a href="$najax.define.html">$najax.define</a></li><li><a href="$najax.history.html">$najax.history</a></li><li><a href="$najax@class.html">$najax@class</a></li><li><a href="$najax@ex.html">$najax@ex</a></li><li><a href="$najax@helper.html">$najax@helper</a></li><li><a href="$najax@read.html">$najax@read</a></li><li><a href="$najax@rlk.html">$najax@rlk</a></li>
				</ul>
			</li>
			
			<li class="dropdown">
				<a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="Linker.html">Linker</a></li><li><a href="Nx.html">Nx</a></li><li><a href="Pager.html">Pager</a></li><li><a href="Reflector.html">Reflector</a></li><li><a href="Relay.html">Relay</a></li><li><a href="RESTful.html">RESTful</a></li><li><a href="Singular.html">Singular</a></li><li><a href="Tx.html">Tx</a></li>
				</ul>
			</li>
			
			<li class="dropdown">
				<a href="tutorials.list.html" class="dropdown-toggle" data-toggle="dropdown">Tutorials<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="tutorial-demo-ui-ajax.html">demo-ui-ajax</a></li><li><a href="tutorial-najax-class.html">najax-class</a></li><li><a href="tutorial-najax-ex.html">najax-ex</a></li><li><a href="tutorial-najax-helper.html">najax-helper</a></li><li><a href="tutorial-najax-read.html">najax-read</a></li><li><a href="tutorial-relaylinker.html">relaylinker</a></li><li><a href="tutorial-rlk-standalone.html">rlk-standalone</a></li><li><a href="tutorial-static-history.html">static-history</a></li><li><a href="tutorial-static-najax-micro.html">static-najax-micro</a></li><li><a href="tutorial-static-najax.html">static-najax</a></li>
				</ul>
			</li>
			
			<li class="dropdown">
				<a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
				<ul class="dropdown-menu ">
					<li><a href="global.html">Global</a></li>
				</ul>
			</li>
			
		</ul>
		<div class="col-sm-3 col-md-3">
            <form class="navbar-form" role="search">
                <div class="input-group">
                    <input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
                    <div class="input-group-btn">
                        <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
                    </div>
                </div>
            </form>
        </div>
	</div>

</div>
</div>


<div class="container" id="toc-content">
<div class="row">

	
	<div class="col-md-12">
	
		<div id="main">
			

		<h1 class="page-title">Source: default/najax-class.static.js</h1>
    
<section>
    <article>
        <pre
            class="sunlight-highlight-javascript linenums">'use strict';

/**
 * $najax helper class.
 *
 * &lt;b>&lt;i>Note! Not included in najax-tiny.js.&lt;/i>&lt;/b>&lt;br>
 *
 * | Method | Default ver | Tiny ver |
 * |:---|:---:|:---:|
 * | All methods | Yes | - |
 *
 * @namespace $najax@class
 *
 * @tutorial najax-class
 * @tutorial demo-ui-ajax
 *
 * @see Singular
 * @see Pager
 * @see Reflector
 *
 * @example
 * var Singular = $najax.Singular();
 *
 * var Pager = $najax.Pager();
 *
 * var Reflector = $najax.Reflector();
 */

/**
 * RESTful class.
 *
 * @class RESTful
 */
var RESTful = function(url){
	this.url(url);

	this._error = null;
	this._header = {};
};

ext(RESTful.prototype, {
	index: function(){
		return this._prepare($najax.request(this._url + '/'));
	},
	create: function(vs){
		return this._prepare($najax.request(this._url + '/', vs).opt('method', 'POST'));
	},
	show: function(id){
		return this._prepare($najax.request(this._url + '/' + id + '/'));
	},
	update: function(id, vs){
		return this._prepare($najax.request(this._url + '/' + id + '/', vs).opt('method', 'PUT'));
	},
	destroy: function(id){
		return this._prepare($najax.request(this._url + '/' + id + '/').opt('method', 'DELETE'));
	},
	url: function(v){
		if (v) {
			v = v.replace(/\/$/, '');
			this._url = v;
		}

		return this;
	},
	error: function(fn){
		this._error = fn;

		return this;
	},
	headers: function(vs){
		this._header = vs;

		return this;
	},
	_prepare: function(o){
		if (this._error) {
			o.fail(this._error);
		}

		if (this._header){
			o.header(this._header);
		}

		return o;
	}
});

/**
 * RESTful-class builder.
 *
 * @function RESTful
 * @memberof $najax@class
 * @returns {RESTful} RESTful class.
 *
 * @see RESTful
 *
 * @tutorial najax-class
 * @tutorial demo-ui-ajax
 *
 */
njx.RESTful = function(){
	return RESTful;
};

/**
 * Singular class. Provide single-access.
 *
 * | Method | Default ver | Tiny ver |
 * |:---|:---:|:---:|
 * | All methods | Yes | - |
 *
 * @class Singular
 *
 * @param {function} [caller] Caller function.
 * @param {function} [error] Error function.
 *
 * @see $najax@class.Singular
 * @see Relay
 *
 * @tutorial najax-class
 * @tutorial demo-ui-ajax
 *
 * @example
 * var Singular = $najax.Singular();
 * var singular = new Singular();
 *
 * single.caller(function(){ ... return rl; });  //Set caller.
 * single.kick();  //Begin.
 * btn.onclick = single.kicker();  //Begin.
 */
var Singular = function(caller, error){
	this._run = false;

	this._caller = caller;
	this._error = error;
};

ext(Singular.prototype, {
	/**
	 * Kick method for bind.
	 * @function
	 * @name kick
	 * @memberof Singular
	 * @instance
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * singular.kick();
	 */
	kick: function(){
		if (this._run){
			if (this._error){
				this._error.apply(this, arguments);
			}

			return;
		}else{
			this._run = true;
		}

		var rl = this._caller.apply(this, arguments);

		njx.linker(rl).done(bind(this, function(){
			this._run = false;
		}));
	},
	/**
	 * Return &lt;i>kick&lt;/i> method for bind. &lt;i>this&lt;/i> in &lt;i>kick&lt;/i> method is Singular object.
	 * @function
	 * @name kicker
	 * @memberof Singular
	 * @instance
	 *
	 * @returns {function} &lt;i>kick&lt;/i> method.
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * btn.onclick = singular.kicker();
	 */
	kicker: function(){
		return bind(this, this.kick);
	},
	/**
	 * Set caller function. The caller function must returns &lt;code>Relay object&lt;/code>.
	 *
	 * &lt;b>Function specification&lt;/b>
	 * &lt;code>function(any:*){ ... return {Relay}; }&lt;/code>
	 *
	 * @function
	 * @name caller
	 * @memberof Singular
	 * @instance
	 *
	 * @param {function} fn Caller function. &lt;code>function(any:*){ ... return {Relay}; }&lt;/code>
	 *
	 * @see Relay
	 * @tutorial najax-class
	 *
	 * @example
	 * singular.caller(fn);
	 * singular.caller(function(){ return $najax.request(url).done(function(data){ ... }); });
	 */
	caller: function(fn){
		this._caller = fn;
	},
	/**
	 * Set error function.
	 * @function
	 * @name error
	 * @memberof Singular
	 * @instance
	 *
	 * @param {function} fn Error function.
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * singular.error(fn);
	 */
	error: function(fn){
		this._error = fn;
	}
});


/**
 * Singular class builder.
 *
 * @function Singular
 * @memberof $najax@class
 *
 * @returns {Singular} Singular class.
 *
 * @see Singular
 *
 * @tutorial najax-class
 * @tutorial demo-ui-ajax
 *
 * @example
 * var Singular = $najax.Singular();
 * var singular = new Singular();
 *
 * single.caller(function(){ ... return rl; });  Set caller.
 * single.kick();  //Begin.
 * btn.onclick = single.kicker();  //Begin.
 */
njx.Singular = function(){
	return Singular;
};

/**
 * Pager class. Provide paging methods.
 *
 * | Method | Default ver | Tiny ver |
 * |:---|:---:|:---:|
 * | All methods | Yes | - |
 *
 * @class Pager
 *
 * @param {function} [fn] Callback function.
 * @param {number} [len] Item length.
 * @param {assoc} [opt] Option.
 * @param {string} [opt.n='n'] Variable name of page number.
 * @param {string} [opt.len='len'] Variable name of item length.
 * @param {string} [opt.all='all'] Variable name of all item length.
 *
 * @see $najax@class.Pager
 *
 * @tutorial najax-class
 * @tutorial demo-ui-ajax
 *
 * @example
 * var Pager = $najax.Pager();
 * var pager = new Pager(function(n, len){... $najax.get('send.php', {n: n, len: len}) ... });
 * var pager = new Pager(null, null, {n: 'pg'});
 *
 * pager.len(15);    //set length of page's items
 * pager.current();  //current
 * pager.move(5);   //move
 * pager.prev();      //prev
 * pager.next();      //next
 * pager.data();     //get data
 * pager.data({all: 100, n:1}); //set data
 * pager.func(fn);  //set function
 */
var Pager = function(fn, len, opt){
	this._filter = fn || null;
	this._len = null;
	this.len(len);
	this._opt = ext({n:'n', len:'len', all:'all'}, opt);

	this._n = 1;
	this._all = -1;
	this._max = -1;
};

ext(Pager.prototype, {
	/**
	 * Set item-length or get item-length.
	 * @function
	 * @name len
	 * @memberof Pager
	 * @instance
	 *
	 * @param {number} [v] Item length.
	 * @returns {void|number}
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * pager.len(v);
	 * len = pager.len();
	 */
	len: function(v){
		if (v === undefined){
			return this._len;
		}

		this._len = v || 10;
	},
	/**
	 * Current.
	 * @function
	 * @name current
	 * @memberof Pager
	 * @instance
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * pager.current();
	 */
	current: function(){
		this.__up();
	},
	/**
	 * Move.
	 * @function
	 * @name move
	 * @memberof Pager
	 * @instance
	 *
	 * @param {number} [v] Page number.
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * pager.move(v);
	 */
	move: function(v){
		this._n = v;
		this.__up();
	},
	/**
	 * Previous.
	 * @function
	 * @name prev
	 * @memberof Pager
	 * @instance
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * pager.prev();
	 */
	prev: function(){
		this._n--;
		this.__up();
	},
	/**
	 * Next.
	 * @function
	 * @name next
	 * @memberof Pager
	 * @instance
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * pager.next();
	 */
	next: function(){
		this._n++;
		this.__up();
	},
	/**
	 * Set data or get data.
	 * @function
	 * @name data
	 * @memberof Pager
	 * @instance
	 *
	 * @param {assoc} [data] Data. &lt;code>{n:n, len:len, all: all}&lt;/code>
	 * @returns {void|assoc} &lt;b>assoc&lt;/b> {n:n, len:len, all: all, max: max}
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * pager.data(data);
	 * data = pager.data();
	 */
	data: function(data){
		if (data == null){
			return {n:this._n, len:this._len, all:this._all, max: this._max};
		}

		if (data[this._opt.n]){
			this._n = data[this._opt.n];
		}

		if (data[this._opt.len]){
			this._len = data[this._opt.len];
		}

		if (data[this._opt.all]){
			this._all = data[this._opt.all];
		}

		this.update();
	},
	/**
	 * Set function.
	 * @function
	 * @name func
	 * @memberof Pager
	 * @instance
	 *
	 * @param {function} fn Function.
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * pager.func(fn);
	 */
	func: function(fn){
		this._filter = fn;
	},
	/**
	 * Update state.
	 * @function
	 * @name update
	 * @memberof Pager
	 * @instance
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * pager.update();
	 */
	update: function(){
		this._n = (this._n &lt; 1)?1:this._n;

		if (this._all > 0){
			this._max = Math.ceil(this._all/this._len);
			this._n = (this._n > this._max)?this._max:this._n;
		}
	},
	/**
	 * @ignore
	 */
	__up: function(){
		this.update();

		this._filter(this._n, this._len);
	}
});

/**
 * Pager-class builder.
 *
 * @function Pager
 * @memberof $najax@class
 * @returns {Pager} Pager class.
 *
 * @see Pager
 *
 * @tutorial najax-class
 *
 * @example
 * var Pager = $najax.Pager();
 * var pager = new Pager(function(n, len){... $najax.get('send.php', {n: n, len: len}) ... });
 *
 * pager.len(15);		//set length of page's items
 * pager.current();	//current
 * pager.move(5);	//move
 * pager.prev();		//prev
 * pager.next();		//next
 * pager.data();		//get data
 * pager.data({all: 100, n:1});	//set data
 * pager.func(fn);	//set function
 */
njx.Pager = function(){
	return Pager;
};

/**
 * Reflector class. Provide ajax request and reflect to content.
 *
 * | Method | Default ver | Tiny ver |
 * |:---|:---:|:---:|
 * | All methods | Yes | - |
 *
 * @class Reflector
 *
 * @param {Nx} [nx=null] Nx object. If null, Create &lt;i>Nx object&lt;/i> automatically.
 *
 * @see $najax@class.Reflector
 *
 * @tutorial najax-class
 * @tutorial demo-ui-ajax
 *
 * @example
 * var reflector = new ($najax.Reflector());
 *
 * reflector.render('#target', url);
 * reflector.render('#target', url, {v: v});
 * reflector.render('#target', url, null, function(v){ ... return v; });
 *
 * var Reflector = $najax.Reflector();
 * var nx = $najax.get(null).timeout(5);
 * var reflector = new Reflector(nx);
 *
 * reflector.type('html').render('#target', url);
 * reflector.typeJson(function(v){ ... return v;}).render('#target', url);
 * reflector.type('json').render('#target', url, null, function(v){ return this.list(v.list, function(k, v){ ... return v;}); });
 */
var Reflector = function(nx){
	this._nx = nx || null;
	this._el = null;
	this._type = null;
	this._filter = null;
};

ext(Reflector.prototype, {
	/**
	 * Set and get Nx object.
	 *
	 * @function
	 * @name nx
	 * @memberof Reflector
	 * @instance
	 *
	 * @param {Nx} [nx] Nx object.
	 * @returns {void|Nx}
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * var nx = $najax.get(null).retry(1);
	 * reflector.nx(nx);       //Set
	 *
	 * vsr nx = reflector.nx(); //Get
	 */
	nx: function(nx){
		if (nx === undefined){
			return this._nx;
		}

		this._nx = nx;

		return this;
	},
	/**
	 * Set type and filter function.
	 *
	 * @function
	 * @name type
	 * @memberof Reflector
	 * @instance
	 *
	 * @param {string} type Type. &lt;code>raw(default), text&lt;/code> / &lt;code>html&lt;/code> / &lt;code>json&lt;/code> / &lt;code>&lt;i>any other Nx.type&lt;/i>&lt;/code>
	 * @param {function} [filter] Filter function. &lt;code>function(v:*){ return {string}; }&lt;/code>
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * reflector.type('html');
	 * reflector.type('json');
	 * reflector.type('raw');
	 * reflector.type(null, function(v){ ... return v;});
	 * reflector.type('json', function(v){ ... return v;});
	 */
	type: function(type, filter){
		this._type = type;
		this.filter(filter);

		return this;
	},
	/**
	 * Set &lt;i>Json&lt;/i> type. Wrapper of &lt;i>type&lt;/i> method.
	 *
	 * @function
	 * @name typeJson
	 * @memberof Reflector
	 * @instance
	 *
	 * @param {function} [filter] Filter function. &lt;code>function(v:*){ return {string}; }&lt;/code>
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * reflector.typeJson();
	 * reflector.typeJson(function(v){ ... return v;});
	 */
	typeJson: function(filter){
		this.type('json', filter);

		return this;
	},
	/**
	 * Set &lt;i>HTML&lt;/i> type. Wrapper of &lt;i>type&lt;/i> method.
	 *
	 * @function
	 * @name typeHtml
	 * @memberof Reflector
	 * @instance
	 *
	 * @param {function} [filter] Filter function. &lt;code>function(v:*){ return {string}; }&lt;/code>
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * reflector.typeHtml();
	 * reflector.typeHtml(function(v){ ... return v;});
	 */
	typeHtml: function(filter){
		this.type('json', filter);

		return this;
	},
	/**
	 * Set filter function.
	 *
	 * @function
	 * @name filter
	 * @memberof Reflector
	 * @instance
	 *
	 * @param {function} [fn] Filter function. &lt;code>function(v:*){ return {string}; }&lt;/code>
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * reflector.filter(function(v){ ... return v;});
	 */
	filter: function(fn){
		this._filter = fn || null;

		return this;
	},
	/**
	 * Create combined string by assoc and function.
	 *
	 * @function
	 * @name list
	 * @memberof Reflector
	 * @instance
	 *
	 * @param {array|assoc} vs Array or Assoc values.
	 * @param {function} fn Filter function for single item. &lt;code>function(v:*){ return {string}; }&lt;/code>
	 * @returns {string} Combined string.
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * reflector.filter(function(v){ return this.list(v.list){ return v.a + ', ' + v.b; } });
	 * reflector.jsonType(function(v){ return this.list(v.list){ return v.a + ', ' + v.b; } });
	 */
	list: function(vs, fn){
		var r = '';

		for (var k in vs){
			if (vs.hasOwnProperty(k)){
				r += fn(k, vs[k]);
			}
		}

		return r;
	},
	/**
	 * Ajax &amp; render to content.
	 *
	 * @function
	 * @name render
	 * @memberof Reflector
	 * @instance
	 *
	 * @param {string|Element} el Element or Element selector.
	 * @param {string} url URL.
	 * @param {assoc} [vs] URL parameter values.
	 * @param {function} [filter] Filter function. See &lt;i>Reflector.filter&lt;/i> for detail.
	 * @returns {Relay} &lt;i>Relay&lt;/i> object by &lt;i>Nx.done&lt;/i>.
	 *
	 * @tutorial najax-class
	 *
	 * @example
	 * reflector.filter(function(v){ return this.list(v.list){ return v.a + ', ' + v.b; } });
	 * reflector.jsonType(function(v){ return this.list(v.list){ return v.a + ', ' + v.b; } });
	 */
	render: function(el, url, vs, filter){
		this._el = el;

		if (!this._nx){
			this._nx = $najax.get(null);
		}

		this._nx.type((this._type == 'html')?'raw':this._type);

		return this._nx.url(url).param(vs).__set('__after', this.__apply(filter)).clean(false).done();
	},
	/**
	 * @ignore
	 */
	__apply: function(fn){
		return bind(this, function(v){
			var el = (typeof this._el === 'string')?document.querySelector(this._el):this._el;
			v = this.__filter(fn, v);

			if (typeof v === 'object'){
				console.error("Can't render object.");
				return;
			}

			switch (this._type){
			case 'html':
				njx.parseHTML(el, v);
				break;
			case 'json':
			case 'raw':
			default:
				el.innerHTML = v;
				break;
			}
		});
	},
	/**
	 * @ignore
	 */
	__filter: function(fn, v){
		if (!fn &amp;&amp; !this._filter){
			return v;
		}

		return (fn || this._filter).call(this, v);
	}
});

/**
 * Reflector-class builder.
 *
 * @function Reflector
 * @memberof $najax@class
 * @returns {Reflector} Reflector class.
 *
 * @see Reflector
 *
 * @tutorial najax-class
 * @tutorial demo-ui-ajax
 *
 * @example
 * var reflector = new ($najax.Reflector());
 *
 * reflector.render('#target', url);
 * reflector.render('#target', url, {v: v});
 * reflector.render('#target', url, null, function(v){ ... return v; });
 *
 * var Reflector = $najax.Reflector();
 * var nx = $najax.get(null).timeout(5);
 * var reflector = new Reflector(nx);
 *
 * reflector.type('html').render('#target', url);
 * reflector.typeJson(function(v){ ... return v;}).render('#target', url);
 * reflector.type('json').render('#target', url, null, function(v){ return this.list(v.list, function(k, v){ ... return v;}); });
 */
njx.Reflector = function(){
	return Reflector;
};

</pre>
    </article>
</section>





		</div>
	</div>

	<div class="clearfix"></div>

	

</div>
</div>

<div class="modal fade" id="searchResults">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">Search results</h4>
      </div>
      <div class="modal-body"></div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div>

<footer>

	&nbsp;


<span class="jsdoc-message">
	Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a>
	
	using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
</footer>

<script src="scripts/docstrap.lib.js"></script>
<script src="scripts/toc.js"></script>
<script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>

<script>
$( function () {
	$( "[id*='$']" ).each( function () {
		var $this = $( this );

		$this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
	} );

	$( ".tutorial-section pre, .readme-section pre" ).each( function () {
		var $this = $( this );

		var example = $this.find( "code" );
		exampleText = example.html();
		var lang = /{@lang (.*?)}/.exec( exampleText );
		if ( lang && lang[1] ) {
			exampleText = exampleText.replace( lang[0], "" );
			example.html( exampleText );
			lang = lang[1];
		} else {
			var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
			lang = langClassMatch ? langClassMatch[1] : "javascript";
		}

		if ( lang ) {

			$this
			.addClass( "sunlight-highlight-" + lang )
			.addClass( "linenums" )
			.html( example.html() );

		}
	} );

	Sunlight.highlightAll( {
		lineNumbers : true,
		showMenu : true,
		enableDoclinks : true
	} );

	$.catchAnchorLinks( {
        navbarOffset: 10
	} );
	$( "#toc" ).toc( {
		anchorName  : function ( i, heading, prefix ) {
			var id = $( heading ).attr( "id" );
			return id && id.replace(/\~/g, '-inner-').replace(/\./g, '-static-') || ( prefix + i );
		},
		selectors   : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
		showAndHide : false,
		smoothScrolling: true
	} );

	$( "#main span[id^='toc']" ).addClass( "toc-shim" );
	$( '.dropdown-toggle' ).dropdown();

    $( "table" ).each( function () {
      var $this = $( this );
      $this.addClass('table');
    } );

} );
</script>



<!--Navigation and Symbol Display-->


<!--Google Analytics-->


<script type="text/javascript">
	$(document).ready(function() {
		SearcherDisplay.init();
	});
</script>

</body>
</html>
